<?php

/**
 * @author 刘军 
 * @version 1.0
 * @package application
 */
class main extends Front_Controller
{
	public function __construct() {
		parent::__construct();
	}

	//获取导航栏
	public function get_nav($topid) {
		
		$data = array();
		$this->load->model('news_class_model');
		$search = array(
			'attributes' => array('parentid' => 0),
			'orders' => array('depth' => 'asc', 'created'=>'desc'),
		);
		$data['nav_data'] = $this->news_class_model->get_values('id', 'sortname', null, $search);
		$data['topid'] = $topid;
		$this->load->view_part($this->_site_path.'/common/nav', $data);
	}
	
	//获取友情链接
	public function get_links(){
		
		$this->load->model('link_model');
		$fields = array('link_title', 'link_url');
		$search = array();
		$search['orders'] = array('link_sort' => 'asc');
		$search['limit'] = array('persize' => 4, 'offset' => 0);
		$data['links'] = $this->link_model->get_appoint_values($fields, null, $search);
		$this->load->view_part($this->_site_path.'/common/links', $data);
 	}
 	
 	//获取验证码
 	public function get_captcha(){
 	
 		$this->load->library('captcha');
 		$img = new captcha('./theme/front/images/captcha/', 50, 25);
 		$img->generate_image();
 	}
	
	

}

